# -*- coding: utf-8 -*-
"""
Created on 2016/3/23 20:34
@File: word.py
@Author: Liangrong Li
@
"""
list_filter = []
with open('word.txt') as words:
    for i in words:
        if len(i) <= 5:
            # l1 = i
            list_filter.append(i)
# print list_filter

try:
    with open('word-filter.txt', 'w') as result:
        for j in list_filter:
            result.write(j)
except Exception, e:
    print e
